import 'package:flutter/material.dart';
import 'pages/study_page.dart';
import 'pages/store_page.dart';
import 'pages/profile_page.dart';

class AppRoutes {
  // 定义路由名称
  static const String home = '/';
  static const String study = '/study';
  static const String store = '/store';
  static const String profile = '/profile';

  // 定义路由映射，不包含home路由('/')
  static final Map<String, WidgetBuilder> routes = {
    study: (context) => const StudyPage(),
    store: (context) => const StorePage(),
    profile: (context) => const ProfilePage(),
  };

  // 导航到指定路由
  static void navigateTo(BuildContext context, String routeName) {
    Navigator.pushNamed(context, routeName);
  }

  // 导航到指定路由并替换当前路由
  static void navigateReplace(BuildContext context, String routeName) {
    Navigator.pushReplacementNamed(context, routeName);
  }
}
